﻿(function ($) {

	$.fn.maxlenkk = function() {
		$("textarea[maxlen], input[maxlen]").keypress(function(event) {
			var key = event.which;
			if (key >= 33 || key == 13 || key == 32) {
				var maxlen = $(this).attr("maxlen");
				var length = this.value.length;
				if (length >= maxlen) {
					event.preventDefault();
				}
			}
		});
	};
 
})(jQuery);